package com.atguigu.yygh.hosp.controller.api;

import com.atguigu.yygh.common.result.R;
import com.atguigu.yygh.hosp.service.HospitalService;
import com.atguigu.yygh.model.hosp.Hospital;
import com.atguigu.yygh.vo.hosp.HospitalQueryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;

@Api(description = "医院接口")
@RestController
@RequestMapping("/admin/hosp/hospital")
@CrossOrigin

public class HospitalController {
    @Autowired
    private HospitalService hospitalService;
    @ApiOperation(value = "带分页、条件查询医院信息列表")
    @GetMapping("getHospPage/{page}/{limit}")
    public R getHospPage(@PathVariable Integer page,
                         @PathVariable Integer limit,
                         HospitalQueryVo hospitalQueryVo){
        Page<Hospital> pages = hospitalService.selectPage(page,limit,hospitalQueryVo);
        return R.ok().data("pages",pages);
    }

}
